<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
        >
<head>
    <title>Devices With Errors</title>

    <link rel="stylesheet" type="text/css" href="../css/style.css" />

    <p:resources />
</head>
<body>
<f:view>
<h:form>
    <table width="100%">
        <tr>
            <td align="right"><a href="javascript:window.close();">Close</a></td>
        </tr>
    </table>
    <p:tabView>
        <p:tab title="Devices With Errors Report">
    <p:dataTable id="tbl" var="device" value="#{devicesWithErrorsInTheirStatus.listDevicesWithErrorsInTheirStatus}" paginator="true" rows="10">
        <p:column>
                <f:facet name="header">
                    <h:outputText value="ID"/>
                </f:facet>
                <h:outputText value="#{device.id}"/>
            </p:column>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Location"/>
                </f:facet>
                <h:outputText value="#{device.location.street.name}"/>
            </p:column>

            <p:column>
                <f:facet name="header">
                    <h:outputText value="Model"/>
                </f:facet>
                <h:outputText value="#{device.model.type}"/>
            </p:column>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Name"/>
                </f:facet>
                <h:outputText value="#{device.name}"/>
            </p:column>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Description"/>
                </f:facet>
                <h:outputText value="#{device.description}"/>
            </p:column>
    </p:dataTable>
    <h:panelGrid columns="1">
         <p:panel header="Export Data">
             <h:commandLink>
                 <p:graphicImage value="icons/excel.png" />
                 <p:dataExporter type="xls" target="tbl" fileName="devicesWithErrors" />
             </h:commandLink>

             <h:commandLink>
                 <p:graphicImage value="icons/pdf.png" />
                 <p:dataExporter type="pdf" target="tbl" fileName="devicesWithErrors"/>
             </h:commandLink>

             <h:commandLink>
                <p:graphicImage value="icons/csv.png" />
                <p:dataExporter type="csv" target="tbl" fileName="devicesWithErrors" />
            </h:commandLink>

            <h:commandLink>
                <p:graphicImage value="icons/xml.png" />
                <p:dataExporter type="xml" target="tbl" fileName="devicesWithErrors" />
           </h:commandLink>


         </p:panel>
     </h:panelGrid>

     </p:tab>
    </p:tabView>

</h:form>
</f:view>
</body>
</html>